package com.dahua.messagesyncsh.business.mitsubishi.controller;


import com.dahua.messagesyncsh.business.mitsubishi.pojo.dto.DecryptDto;
import com.dahua.messagesyncsh.business.mitsubishi.pojo.vo.PushResponseVo;
import com.dahua.messagesyncsh.business.mitsubishi.service.PushAgentService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author smec
 * @description demo
 * @date 2022/09/13 10:51
 */
@RestController
@RequestMapping("/v1/openapi")
@RequiredArgsConstructor
@Slf4j
public class TestController {

    private final PushAgentService pushAgentService;

    /**
     * Desc:推送故障信息
     *
     * @author smec
     * @date 2022/10/11 13:10
     */
    @PostMapping(value = "/push/fault/info")
    public PushResponseVo pushFaultInfo(@RequestParam("eventType") String eventType,
                                        @RequestParam("corpId") String corpId,
                                        @RequestBody DecryptDto encryptedVo) {

        return pushAgentService.handlePushInfo(eventType, corpId, encryptedVo);
    }

}
